import { delManyBet } from '@/apis/betAPI'
import { delManyTower } from '@/apis/towerAPI'
import { readAcross } from './readAcross'
import { readBet } from './readBet'
import { readTower } from './readTower'
import { readFromXlsx } from './readXlsx'
import { delManyAcross } from '@/apis/acrossAPI'
import { readWire } from './readWire'

export async function read(id: number) {
  await delManyTower(id)
  await delManyBet(id)
  await delManyAcross(id)
  await readFromXlsx(async (wb) => {
    await readTower(wb, id)
    await readBet(wb, id)
    await readAcross(wb, id)
  })
}

export async function readManyWire() {
  console.log('readManyWire')
  await readFromXlsx(async (wb) => {
    await readWire(wb)
  })
}
